

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using JTC.MiniCommerce.Core;
using JTC.MiniCommerce.Localization;
using SubSonic.Utilities;

namespace JTC.MiniCommerce.Web.install {
  public partial class install : System.Web.UI.Page {

    #region Member Variables

    private int step = 0;

    #endregion


    protected void Page_Load(object sender, EventArgs e) {
      try {
        step = Utility.GetIntParameter("step");
        Control installControl = null;
        switch(step) {
          case 0:
            installControl = Page.LoadControl("~/install/controls/welcome.ascx");
            break;
          case 1:
            installControl = Page.LoadControl("~/install/controls/database.ascx");
            break;
          case 2:
            installControl = Page.LoadControl("~/install/controls/connectionstring.ascx");
            break;
          case 3:
            installControl = Page.LoadControl("~/install/controls/membership.ascx");
            break;
          case 4:
            installControl = Page.LoadControl("~/install/controls/complete.ascx");
            break;
        }

        pnlInstall.Controls.Clear();
        pnlInstall.Controls.Add(installControl);
      }
      catch(Exception ex) {
        Logger.Error(typeof(install).Name + ".Page_Load", ex);
        Master.MessageCenter.DisplayCriticalMessage(LocalizationUtility.GetCriticalMessageText(ex.Message));
      }

    }
  }
}
